package vip.xiaonuo.biz.modular.timetable.domain;

/**
 * Simple course module abstraction, which defines the Professors teaching the module.
 */
public class Module {
    private final String moduleId;
    private final String module;
    private final int timesPerWeek;
    private final String professorIds[];
    
    /**
     * Initialize new Module
     *
     * @param moduleId
     * @param module
     * @param timesPerWeek
     * @param professorIds
     */
    public Module(String moduleId, String module, int timesPerWeek, String[] professorIds){
        this.moduleId = moduleId;
        this.module = module;
        this.timesPerWeek = timesPerWeek;
        this.professorIds = professorIds;
    }
    
    /**
     * Get moduleId
     *
     * @return moduleId
     */
    public String getModuleId(){
        return this.moduleId;
    }

    /**
     * Get module name
     * 
     * @return moduleName
     */
    public String getModuleName(){
        return this.module;
    }

    public int getTimesPerWeek() {
        return timesPerWeek;
    }

    /**
     * Get random professor Id
     *
     * @return professorId
     */
    public String getRandomProfessorId(){
        String professorId = professorIds[(int) (professorIds.length * Math.random())];
        return professorId;
    }
}
